package com.wangx1n.service;

import com.wangx1n.dao.UserDao;
import com.wangx1n.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author WangXin
 * @date 2020/12/4 15:10
 */
@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public void addUser(User user){
        userDao.addUser(user);
    }

    public void updateUser(User user){
        userDao.updateUser(user);
    }

    public void deleteUser(User user){
        userDao.deleteUser(user);
    }

    public Integer selectUserCount(){
       return userDao.selectUserCount();
    }

    public User selectUser(Integer userId){
        return userDao.selectUser(userId);
    }

    public List<User> selectUsers(){
        return userDao.selectUsers();
    }

    public void batchAddUser(List <Object[]> batchArgs){
        userDao.batchAddUser(batchArgs);
    }

    public void batchUpdateUser(List <Object[]> batchArgs){

        userDao.batchUpdateUser(batchArgs);
    }

    public void batchDeleteUser(List <Object[]> batchArgs){
        userDao.batchDeleteUser(batchArgs);
    }
}
